a = {}
a[1] = {
    "a1": [1, 2, 3, 4, 5],
    "a2": [6, 7, 8, 9, 10],
    "a3": {
        "a3_a": (1, 2),
        "a3_b":{
            "a3_b_1":[1,2,3,4]
        }
    }
}
def deep_get(dictionary, keys, default=None):
    """
    安全地从嵌套字典中获取值。

    :param dictionary: 要搜索的字典
    :param keys: 键的列表或用点号分隔的字符串
    :param default: 如果找不到则返回的默认值
    :return: 找到的值或者默认值
    """
    if isinstance(keys, str):
        keys = keys.split('.')
    for key in keys:
        try:
            dictionary = dictionary.get(key)
            if dictionary is None:
                return default
        except AttributeError:
            return default
    return dictionary


# 使用辅助函数获取"a3_a"的值
result = deep_get(a[1], ["a3", "a3_a"])

print(result)  # 输出应为：(1, 2)

# 或者使用点号分隔的字符串形式
result = deep_get(a[1], "a3.a3_a")

print(result)  # 输出应为：(1, 2)

b = a[1]["a3"]["a3_a"]
c = a[1].get("a3").get("a3_b").get("a3_b_1")
print(8)
